The raw data and code are both organized in directory structure. Understanding the data and code will be easier if you view it with that structure in tact.



Scripts should be run in the following order. Scripts are annotated throughout.

00_initialize.R: load in packages used throughout project.

01_block_group_acs_data.R: pull ACS data for years in study using Tidycensus.

02_process_voter_files: These files pull from the individual-level voter files and calculate the number of ballots
cast in each block group. The data to run these are not provided; instead, we provide the outputs from these scripts.

03_rdit_code/01_distance_btwn_bgs_killings.R: Calulate distance between each block group's centroid and the nearest killing
03_rdit_code/02_primary_rdit_models.R: Run the primary RDiT models 
03_rdit_code/03_rdit_models_by_nhood_victim_race.R: Run the victim and neighborhood-specific models
03_rdit_code/04_code_trends.R: Determine whether victim names trended on Google
03_rdit_code/05_trend_regs.R: Run the RDiTs for trending / non-trending killings
03_rdit_code/06_robustness_rdit_models.R: Run the majority of the robustness tests here
03_rdit_code/07_placebos/01_distance_btwn_bgs_killings_4months_placebo.R: Determine distance to killings occuring 1 year before election day
03_rdit_code/07_placebos/02_primary_rdit_models_placebo.R: Run placebo RDiTs for killings 1 year before election day
03_rdit_code/08_modelled_race.R: Model races of unknown victims using rethnicity.
03_rdit_code/09_tables.R: Create LaTeX tables for each regression. These are the tables included in Supplementary Materials B.
04_minn_abolish.R: Run Minneapolis-specific analysis
05_map.R: Create maps

